package com.ruifu.doc.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.fhzncloud.cloud.common.security.service.CloudUser;
import com.ruifu.common.po.ObjectPermissionsAuthorization;
import com.ruifu.common.vo.worksheet.WsCommonSheet;

/**
 * @author lcq
 * @create 2020/5/18
 */
public interface PermissionsService extends IService<ObjectPermissionsAuthorization> {
    /**
     * 文档权限初始化
     * @param sourceTenantId  源账套
     * @param newTenantId 目标账套
     * @return
     */
    Boolean insertPermission(Integer sourceTenantId, Integer newTenantId);

    /**
     * 文档类型初始化
     * @param sourceTenantId  源账套
     * @param newTenantId 目标账套
     * @return
     */
    Boolean insertDocType(Integer sourceTenantId, Integer newTenantId);

    /**
     * 工作单权限计算
     * @param wsCommonSheet  工作单主键
     * @return
     */
    String findPermissionByWorkFormId(WsCommonSheet wsCommonSheet, CloudUser cloudUser);

    /**
     * 当前登录用户是否在流程办理人中
     * @param userId 当前用户id
     * @param nodeUserIdList 节点办理人字符串
     * @return
     */
    Boolean isNodeHandlerUser(Integer userId, String nodeUserIdList);

    Boolean isMeet(String currentStep, Integer userId, String nodeUserIdList, String currentStepString);
}
